from peewee import *

from service.das.database_pool import DatabasePool


class StrategyBinding(Model):
    id = AutoField()  # 自增主键
    stock_category = CharField(max_length=50)  # 股票分类
    stock_code = CharField(max_length=20, null=True)  # 股票代码（可为空）
    strategies = TextField()  # 策略列表（存储为逗号分隔的字符串）

    # 新增字段
    strategy_code = CharField(max_length=50)  # 策略代码
    strategy_name = CharField(max_length=100)  # 策略可读名称
    strategy_group = CharField(max_length=100)  # 策略分组
    strategy_type = CharField(max_length=100)  # 策略类型
    analysis_day = IntegerField(default=0)  # 策略分析的天数
    strategy_level = IntegerField(default=1)  # 策略等级

    class Meta:
        database = DatabasePool(max_connections=5).database
        table_name = "strategy_bind_setting"
